<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta charset="utf-8">
    <!--[if IE]>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <![endif]-->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Page title -->
    <title>Petz - Pet HTML5 Template</title>
    <!--[if lt IE 9]>
    <script src="${pageContext.request.contextPath}/foreground/js/respond.js"></script>
    <![endif]-->
    <!-- Bootstrap Core CSS -->
    <link href="${pageContext.request.contextPath}/foreground/css/bootstrap.css" rel="stylesheet" type="text/css">
    <!-- Icon fonts -->
    <link href="${pageContext.request.contextPath}/foreground/fonts/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="${pageContext.request.contextPath}/foreground/fonts/flaticons/flaticon.css" rel="stylesheet" type="text/css">
    <link href="${pageContext.request.contextPath}/foreground/fonts/glyphicons/bootstrap-glyphicons.css" rel="stylesheet" type="text/css">
    <!-- Google fonts -->
    <link href="https://fonts.googleapis.com/css?family=Lato:400,800" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Baloo+Thambi" rel="stylesheet">
    <!-- Style CSS -->
    <link href="${pageContext.request.contextPath}/foreground/css/style.css" rel="stylesheet">
    <!-- Plugins CSS -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/foreground/css/plugins.css">
    <!-- Color Style CSS -->
    <link href="${pageContext.request.contextPath}/foreground/styles/maincolors.css" rel="stylesheet">

    <script src="${pageContext.request.contextPath}/background/js/jquery.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/background/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/background/js/xadmin.js"></script>

</head>
<body>
<%--导航栏--%>
<%@ include file="../common/topbar.jsp" %>


<section id="adoption" class="pages">
    <div class="jumbotron" data-stellar-background-ratio="0.5">
        <div class="jumbo-heading" data-stellar-background-ratio="1.2">
            <h1>求助</h1>
        </div>
    </div>

    <div class="row margin1 text-center">
        <!-- 圆形的第一个模块-->
        <div class="features col-lg-3 col-sm-6 col-xs-12">
            <div class="col-xs-12 big-icon">
                <!-- icon -->
                <i class="flaticon-dog-and-pets-house"></i>
            </div>
            <!-- 第一模块文字 -->
            <div class="col-xs-12">
                <h5>流浪动物</h5>
                <p>如果您发现了流浪动物的踪迹可以与我们联系，我们会将它带回中心，对其进行救助</p>
            </div>

            <a class="btn" onclick="DetermineLoginHelp()">求助</a>
        </div>


        <!-- 圆形的第二个模块-->
        <div class="features col-lg-3 col-sm-6 col-xs-12">
            <div class="col-xs-12 big-icon">
                <!-- icon -->
                <i class="flaticon-dog-in-front-of-a-man"></i>
            </div>
            <div class="col-xs-12">
                <h5>领养动物</h5>
                <p>如果您想拥有一只小动物陪伴您的话，您可以进入领养模块领养一只小动物</p>
            </div>
            <a class="btn" href="allAnimalParentType?tyParentId=0&&page=adopt">求助</a>

        </div>


        <!-- 下面圆形的第三个模块-->
        <div class="features col-lg-3 col-sm-6 col-xs-12">
            <div class="col-xs-12 big-icon">
                <!-- icon -->
                <i class="flaticon-veterinarian-hospital"></i>
            </div>
            <div class="col-xs-12">
                <h5>动物医救</h5>
                <p>如果您家的动物需要医疗救助的话，您可以点击这里，不过可能需要您进行些义工活动</p>
            </div>
            <button class="btn" onclick="DetermineLogin('医救')">求助</button>

        </div>


        <!-- 下面圆形的第四个模块-->
        <div class="features col-lg-3 col-sm-6 col-xs-12">
            <div class="col-xs-12 big-icon">
                <!-- icon -->
                <i class="flaticon-animals-3"></i>
            </div>
            <div class="col-xs-12">
                <h5>动物清洁</h5>
                <p>如果您家的动物需要清洁帮助的话，您可以点击这里，不过可能需要进行些义工活动</p>
            </div>
            <button class="btn" onclick="DetermineLogin('清洁')">求助</button>

        </div>

    </div>

</section>

<script>
    function DetermineLoginHelp(){
        //发异步删除数据
        $.ajax({
            url:"DetermineLoginHelp",
            type:"POST",
            success:function(data){//从servlet获取返回数据data:{SUCCESS ERREO}
                if(data=="Login"){
                    layer.confirm('您还未登录，是否现在去登录？',function(index){
                        window.location.href = 'user-login'; //跳转页面路径;
                    })

                }else if(data=="SUCCESS"){

                    window.location.href = 'help-stray'; //跳转页面路径;
                }
            }
        });
    }
    function DetermineLogin(reType){
        //发异步删除数据
        $.ajax({
            url:"GetReserveType",
            data:{"reType":reType},//servlet按照"classobj_id"取值
            type:"POST",
            success:function(data){//从servlet获取返回数据data:{SUCCESS ERREO}
                if(data=="Login"){
                    layer.confirm('您还未登录，是否现在去登录？',function(index){
                        window.location.href = 'user-login'; //跳转页面路径;
                    })

                }else if(data=="SUCCESS"){

                    window.location.href = 'help-cure'; //跳转页面路径;
                }
            }
        });
    }
</script>
</body>
</html>
